﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Security.Cryptography;

namespace DASecurity
{
    public class clsSecurity
    {
        // Encrypt/Decrypt with md5
        public string HashPasswordWithMD5(string originalPassword)
        {
           //Declarations
            Byte[] originalBytes;
            Byte[] encodedBytes;
            MD5 md5;

            //Instantiate MD5CryptoServiceProvider, get bytes for original password and compute hash (encoded password)
            md5 = new MD5CryptoServiceProvider();
            originalBytes = ASCIIEncoding.Default.GetBytes(originalPassword);
            encodedBytes = md5.ComputeHash(originalBytes);

            //Convert encoded bytes back to a 'readable' string
            return BitConverter.ToString(encodedBytes);
        }

        // Validate Email
        public static bool ValidateEmail()
        {
            bool valid=false;
            return valid;
        }

        // Validate Datetime
        public static bool ValidateDateTime()
        {
            bool valid = false;
            return valid;
        }
     }
}